//两个组件不会共享useReducer中的state，只会使用同一个reducer函数。
export default function reducer(state, action) {
  switch (action.type) {
    case "IN_CREMENT":
      return {...state, count: state.count + 1 };
    case "DE_CREMENT":
      return {...state, count: state.count - 1};
    default:
      return state;
  }
}